package com.kopo.droidlipokit;

import ioio.lib.util.IOIOLooper;
import android.util.Log;

import com.kopo.droidioiolib.ControlDevice;
import com.kopo.droidioiolib.ControlInterface;
import com.kopo.droidioiolib.LipoKitInterface;

public class MyControlDevice extends ControlDevice {
    private static final String TAG = "kopo.log";

    // Called when an IOIO device is connected to create a thread (IOIOLooper)
    // We can look at the connection information to decide whether to create a thread for the device.
	@Override
	public IOIOLooper createIOIOLooper(String arg0, Object arg1) {
    	Log.d(TAG, "ControlDevice.createIOIOLooper");

		ControlDevice.controlInterface = new LipoKitInterface();  // create a thread handler
		ControlInterface.me = ControlDevice.controlInterface;
		return ControlDevice.controlInterface;  // IOIOLooperProvider will create a thread and call theInterface.loop() in the thread
	}

}
